﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp4
{
    class Context
    {
        private AbstractFactory Factory;
        public Context(int type)
        {
            switch (type)
            {
                case 0:
                    Factory = new NanChangFactory();
                    break;
                case 1:
                    Factory = new ShangHaiFactory();
                    break;
                case 2:
                    Factory = new HuNanFactory();
                    break;
            }
        }

        public void Print()
        {
            Factory.CreateYaBo().Print();
            Factory.CreateYaJia().Print();
            //YaBo yabo = Factory.CreateYaBo();
            //YaJia yajia = Factory.CreateYaJia();
            //yabo.Print();
            //yajia.Print();
        }
    }
}
